<template>
	<view class="content">
        <u-navbar :fixed="true" :shadow="true" :safeAreaInsetTop="true" :placeholder="true"
            @leftClick="back" title="人员工资详情">
        </u-navbar>

        <view class="uni-area">
            <!-- 工资发放详情 -->
            <uni-item-base class="u-m-t-30" :baseData="generalData" />
        </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
                // 工资发放概况
                generalData:{
                    line: false,
                    title: '工资发放概况',
                    list: [
                        { filed:'ryxm', title:'人员名字', value:'安薪乐'  },
                        { filed:'zjhm', title:'身份证号', value:'安薪乐' },
                        { filed:'', title:'所属企业', value:'安薪乐'  },
                        { filed:'bzmc', title:'班组名称', value:'安薪乐' },
                        { filed:'', title:'工资期(间)', value:'安薪乐' },
                        { filed:'', title:'发放日期', value:'安薪乐' },
                        { filed:'yfje', title:'应发金额', value:'安薪乐', unit:'元' },
                        { filed:'sfje', title:'实发工资', value:'安薪乐', unit:'元' },
                    ]
                },
			}
		},

		onLoad(option) {
            // 工资发放概览
            this.getWageSalaryMemberDetail(option.ywbh,option.id)
        },

		methods: {
            // 返回
            back(){
                uni.navigateBack()
            },

            // 人员工资详情
            getWageSalaryMemberDetail(ywbh,rybh){
                uni.showLoading({ title:'人员工资详情' })
                const parameter = {
                    ywbh: ywbh, // 业务编号 ryxx_21120315592400000001
                    rybh: rybh // 人员id kqgzgl_21122516373300000008
                }
                this.$request(this,this.$apis.WageSalaryMemberDetail,parameter).then(res=>{
                    console.log('人员工资详情',res)
                    this.generalData.list.map((v,i)=>{
                        if( v.filed ){
                            if( v.filed == 'zjhm' ){
                                v.value = res[v.filed]?this.$tools.formatIdentity(res[v.filed]):res[v.filed]
                            }else{
                                v.value = res[v.filed]
                            }
                        }else{
                            v.value = '无相关字段'
                        }
                    })
                }).then()
            }
		}
	}
</script>

<style scoped lang="scss">
    // .content{}
</style>
